package cn.jeefast.rest.service.impl;

import cn.jeefast.common.entity.MbResearch;
import cn.jeefast.common.entity.MbResearchData;
import cn.jeefast.common.utils.R;
import cn.jeefast.rest.dao.MbResearchDataDao;
import cn.jeefast.rest.service.MbResearchDataService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author theodo
 * @since 2019-12-30
 */
@Service
public class MbResearchDataServiceImpl extends ServiceImpl<MbResearchDataDao, MbResearchData> implements MbResearchDataService {

    @Autowired
    private MbResearchDataDao mbResearchDataDao;

    @Override
    public R auditFailed(Long docId, Integer page, Integer limit) {
        List<Map> lists = mbResearchDataDao.auditFailed(docId, page, limit);
        EntityWrapper ew = new EntityWrapper();
        ew.eq("doc_id",docId);
        ew.eq("state",2);
        List list = mbResearchDataDao.selectList(ew);
        Map result = new HashMap();
        result.put("dataList",lists);
        result.put("count",list.size());
        return R.ok("").put("data",result);
    }
}
